<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>设置空函数</title>
</head>

<body>
  <!-- 
  typeof Function.prototype === 'function';  // true
  function People() {}
  typeof People.prototype === 'object';      // true

  Function.prototype 竟然是个函数类型。而自定义函数的原型却是对象类型。
-->
</body>
<script>
  "use strict"; {
    // Good 设置一个空函数的推荐方法
    const noop = Function.prototype;
    // Bad
    const noop = () => { };
  };
</script>

</html>